from django.urls import path,re_path
from rest_framework.routers import SimpleRouter
from main.system.views import login,user,role,permission,routes, menu

router = SimpleRouter()
router.register('user', user.UserViewSet, basename='user')
router.register('menu',menu.MenuViewSet, basename='menu')

urlpatterns = [
    path('login', login.LoginView.as_view()),
    path('logout', login.LogoutView.as_view()),
    path('user/info', user.UserInfoView.as_view()),
    path('user/<int:pk>', user.UserView.as_view()),
    path('roles', role.RoleListView.as_view()),
    path('role/', role.RoleDetailView.as_view()),
    path('permission', permission.PermissionView.as_view()),
    path('routes', routes.RoutesView.as_view()),
]

urlpatterns += router.urls


